package com.yida.wy.vote.domain.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yida.wy.common.valid.Save;
import com.yida.wy.common.valid.Submit;
import com.yida.wy.common.valid.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.util.Date;

/**
 * @author lqq
 * @date 2023-03-10
 */
@ApiModel("投票项目对象请求")
public class WyVoteProjectRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("投票ID")
    @Null(groups = Save.class, message = "请求参数有误[voteId]不能有值")
    @NotNull(groups = {Update.class, Submit.class}, message = "请求参数有误[voteId]为空")
    private Long voteId;

    @ApiModelProperty("地区ID")
    @NotNull(message = "请求参数有误[areaId]为空")
    private Long areaId;

    @ApiModelProperty("投票标题")
    @NotBlank(message = "投票标题不能为空")
    private String voteTitle;

    @ApiModelProperty("投票发起时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "请选择投票发起时间")
    private Date startTime;

    @ApiModelProperty("投票结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "请选择投票结束时间")
    private Date endTime;

    @ApiModelProperty("公示截止时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date publicEndTime;

    @ApiModelProperty("投票说明内容")
    @NotBlank(message = "投票投票说明内容")
    private String voteContent;

    @ApiModelProperty("业务编码")
    @NotNull(groups = {Save.class}, message = "请求参数有误[bizNum]为空")
    private Long bizNum;

    @ApiModelProperty("业务ID")
    @NotNull(groups = {Save.class}, message = "请求参数有误[bizId]为空")
    private Long bizId;

    public Date getPublicEndTime() {
        return publicEndTime;
    }

    public void setPublicEndTime(Date publicEndTime) {
        this.publicEndTime = publicEndTime;
    }

    public Long getAreaId() {
        return areaId;
    }

    public void setAreaId(Long areaId) {
        this.areaId = areaId;
    }

    public Long getBizNum() {
        return bizNum;
    }

    public void setBizNum(Long bizNum) {
        this.bizNum = bizNum;
    }

    public Long getBizId() {
        return bizId;
    }

    public void setBizId(Long bizId) {
        this.bizId = bizId;
    }

    public Long getVoteId() {
        return voteId;
    }

    public void setVoteId(Long voteId) {
        this.voteId = voteId;
    }

    public String getVoteTitle() {
        return voteTitle;
    }

    public void setVoteTitle(String voteTitle) {
        this.voteTitle = voteTitle;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getVoteContent() {
        return voteContent;
    }

    public void setVoteContent(String voteContent) {
        this.voteContent = voteContent;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("VoteProjectRequest{");
        sb.append("voteId=").append(voteId);
        sb.append(", voteTitle='").append(voteTitle).append('\'');
        sb.append(", startTime=").append(startTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", voteContent='").append(voteContent).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
